(function($) {
    var ___LOADED___ = []; 
	$.imports = function(type,srcs,callback,args) {
		 srcs=srcs||[];	 
		 for (i = 0; i < srcs.length; ++i) {
			 var src=srcs[i];
			 if(!___LOADED___[src]){
				 if(type=='css'){
					 $("head").append("<link>");
					 var css = $("head").children(":last");
					 css.attr( {
						 rel : "stylesheet",
						 type : "text/css",
						 href : src
					 });
					 ___LOADED___[src]=true;
				 }else if(type=='js'){
					 try{
						 jQuery.getScript(src);
						 ___LOADED___[src]=true;
					 }catch(e){
						 alert('error: when load "' + src + '"! \r\n[at line: ' + e.lineNumber  + ' , ' + e.message+']');
					 }
				 }
			 }else{
				 alert(src+' already loaded!');	
			 }
		 }//end for
		 if($.isFunction(callback)){
			   $.callback(callback,args).call();
		 }
	}
	
 /**
  * jQuery Callback
  * @author Alberto Bottarini <alberto.bottarini@gmail.com
  * @version 1.1
  * @homepage http://code.google.com/p/jquerycallback
  *
  * jQuery-callback permits jQuery developer to have a real control to their callback functions. 
  * With this plugin you can set custom parameters and custom scope to each callback defined in your script. 
  */
	var asArray = function(a) {
		return Array.prototype.slice.call(a,0);
	}
	$.delegate = function(func, scope, params, overwriteDefault) {
		if(!$.isArray(params)) params = [params];
		return function() {
			if(!overwriteDefault) func.apply(scope, asArray(arguments).concat(params));
			else func.apply(scope, args);
		}
	}	
	$.callback = function(func, params, overwriteDefault) {
		return $.delegate(func, this, params, overwriteDefault);
	}

})(jQuery);